package com.szx.kaihei.util;

import cn.hutool.crypto.digest.BCrypt;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;


public class PwdToSecretUtil {

    //密码加密
    public static String encode(String password) {
        return BCrypt.hashpw(password,BCrypt.gensalt(9));
    }

    //密码验证
    public static boolean verify(String password, String hashedPassword) {
        return BCrypt.checkpw(password, hashedPassword);
    }
}
